﻿using System;
using System.Collections.Generic;
using ReportLib;
using Sparkle.Hosting;
using Sparkle.Wpf.Demo.UI.MenuEntities;

namespace Sparkle.Wpf.Demo.UI.Attributes
{
    [AttributeUsage(AttributeTargets.All, Inherited = false, AllowMultiple = true)]
    public class LinkDocumentsAttribute : DynamicLinkAttribute, IEntityAttribute
    {
        public int EntityId { get; set; }

        public string Title { get; set; }

        public LinkDocumentsAttribute()
        {
            
        }

        public LinkDocumentsAttribute(string title, int entityId)
        {
            Title = title;
            EntityId = entityId;
        }

        public override string ToString()
        {
            return Title;
        }

        #region Implementation of IDynamicLink

        public override IList<object> GetDynamicLinks(object refEntity)
        {
            var retuList = new List<object>
                               {
                                   new LinkDocument { Document = refEntity + " Details"  },
                                   new LinkDocument {Document = refEntity + " Holidays"},
                                   new LinkDocument {Document = refEntity +" Sickness"}
                               };

            return retuList;
        }

        #endregion
    }
}

namespace Sparkle.Wpf.Demo.UI.MenuEntities
{
}